<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>在vue中使用插槽</title>
  <script src="./vue.js"></script>
</head>

<body>
  <!-- <div id="root">
    <child></child>
    <child></child>
  </div> -->

  <div id="root2">
    <child>
      <p>yes</p>
    </child>
  </div>
  <script>
    // Vue.component("child", {
    //   template: '<div>child</div>'
    // })
    Vue.component("child", {
      template: `<div>
                  <p>hello</p>
                  <slot>默认内容</slot>
                </div>`
    })
    var vm = new Vue({
      el: "#root2",
    })
  </script>
</body>

</html>